/*
 * ReadWriteAdapter.h
 *
 *  Created on: Sep 16, 2017
 *      Author: zjf
 */

#ifndef INCLUDE_PACKETREADERWRITER_H_
#define INCLUDE_PACKETREADERWRITER_H_

#include <Poco/Types.h>

using namespace Poco;

namespace utils
{

class PacketReader
{
public:
	PacketReader() {}
	virtual ~PacketReader() {}

	virtual int read(char *pBuff, const Int32 len) = 0;
};

class PacketWriter
{
public:
	PacketWriter() {}
	virtual ~PacketWriter() {}

	virtual int write(const char *pBuff, const Int32 len) = 0;
};

class PacketReaderWriter : public PacketWriter, public PacketReader
{
public:
	PacketReaderWriter() {}
	virtual ~PacketReaderWriter() {}

	virtual int read(char *pBuff, const Int32 len) = 0;
	virtual int write(const char *pBuff, const Int32 len) = 0;
};

} /* namespace utils */

#endif /* INCLUDE_PACKETREADERWRITER_H_ */
